import { playerClass } from "./model/playerModel"

export interface KeyObject<T> {
    [index: string] : T;
}
export const relationObject = {
    "parent": "父母",
    "father": "父亲",
    "monther": "母亲",
    "son": "儿女",
    "love": "情侣",
    "friend": "朋友",
    "couples": "爱人",
}
export enum edu {
    "wu" = 0,
    "youeryuan",
    "xiaoxue",
    "chuzhong",
    "gaozhong",
    "daxue",
    "yanjiusheng",
    "boshi",
}
//属性
export interface attribute {
    id: string,
    key: string,
    name: string,
    exp: number, //经验
    point: number, //加点
}
//工作
export type workType = {
    "id": number | string,
    "name": string,
    "income": number, //本月工资
     wage: number, //应得工资
    "levelName":string[],
    "exp": number[],
    "gains": number[],
     need: string,
    "lock": boolean,
     level: number, //当前等级
     workTime: number,//每天上班时间
     curExp: number,//当前经验
     power: number,
     desc: string,
     startTime: number[], //上班开始时间
     unWorkDay: number, //旷工时间
     costTime: number, //路程
     pressure: number, //今日是否打卡过
}
//排名
export type rankItemType = {
    id: string | number,
    name: string,
    money: number,
    monthIncome: number,
    age: number, //年龄
    work: string, //工作
    child: number,
}
//玩家
export type playerType = {
    name: string,
    id: number | string,
    money: number,
    age: number,
    lifeTime: number,//寿命
    health: number, //健康情况
    products: [], //产业
    sex: string,
    work: workType, 
    works: workType[],
    family: [], //家庭
    charm: number, //魅力
    incomeMonth: number, // 月收入
    assetsPayMonth: number, //固定支出
    assetsIncomeMonth: number, //固定收益
    incomeYear: number, //年收入
    payMonth: number, //年zhichu
    payYear: number, //
    pressure: number,  //影响做事的效率
    learn: number, //学习能力
    iq: number,
    rent: number, //房租
    eq: number,
    rank: {
        id: number,
        star: number,
    }
    edu: eduType,
    power: number, //精力 做事消耗特定精力， 健身增强身体素质， 最高10级，一级增加10点精力
    maxPower: number, //最大精力值
    traffic: assetsType,
    school: schoolType,
    skill: skillType[], //技能
    house: assetsType,
    eduScore?: number, //升学分数
    relation: {
        chat?: relationType,
        wife?: relationType,
        love?: relationType,
        father: relationType,
        monther: relationType,
        list: relationType[]
    },
    disease: diseaseType[],
    achieve: achieveType[],
    companyList: companyType[],
}
export type schoolType = {
    id: number,
    name: string,
    desc: string,
    type: string,
    score: number,
    price: number,
    learn: Object,
    state: number, //就学状态 0 为停学
    power: number,
    work: string | number,
    year: number,
    leftYear: number,
    pressure: number,
}
// 技能
export type skillType = {
    level: number,
    "exp": number[],
    "gains": number[],
    "id": number,
    "name": string,
    "lock": boolean,
    curExp: number,//当前经验
}
//关系属性
export type relationType = {
    id: string | number,
    relation: string,
    hero: playerType,
    intimate: number, //亲密
}
//人物生成列表
export type figureType = {
    id: number,
    name: string,
    sex: number,
    money: number,
    age: number,
    relation: string,
}
//送礼物等行为  
export type giftType = {
    id: number | string,
    name: string,
    desc: string,
    effect: number,
    condition: any,
    cost: number,
    power: number,
}
//食物
export type foodModel = {
    name: string,
    effect: {
        mood: number,
        hungry: number,
        health: number,
    },
    time: number,
    product: number,
    type: number,// 食物类型
    price: number,
}
export type lineType = {
        effect: number,
        count: number,
        cost: number,
        state: number, //状态 
        month: number, //生产力
        person: number,
}
//公司 公司职位： ceo， 能力： 管理和专业技能影响收益， 基础盈利概率为和生产效率为0, ceo的管理影响员工效率，专业技能和魅力影响盈利概率， 管理：90 ，技能：,80，魅力：80  生产90%， 盈利80%
//招聘方面： 分为社招方式，校招方式，猎头招聘， 价格不一样，魅力越大，找的人越强
export type companyType = {
    name: string,
    id: number,
    desc: string,
    inverst: number,
    skill: string, //技能
    material: string,
    ceo: playerType,
    money: number, //资金
    incomeMonth: number,
    workers: number, //人数
    wage: number, //平均工资
    level: number, //等级
    levelCost: number,
    rent: number, //租金
    pay: number, //工资支出
    payMonth: number, //支出
    incomeYear: number, 
    earnProb: number, //盈利概率, 负收益可能导致今日的收入全部为负数
    maxWorker: number,
    power: number, //管理消耗的精力
    year: number,
    makeType: lineType,
    salesType: lineType,
    materialCount: number, //原材料数
    productCount: number, //产品数
    resumeList: playerType[], //候选人才
    addWorker: number,
    isLock: number, //是否可以开启
    debt: number,
}

export type gambleType = {
    id: string,
    name: string,
    desc: string,
    money: number,
    power: number,
    max: number
}
export type productModel = {
    //产品生产
    id: number,
    name: string,
    time: number, //生产时长 单位小时， 0.1
    type: number, //类型， 特定的产业生产 
    price: number,
    cost: number, //成本
    
}
 //培训的数据
export type studyModel = {
    id: number,
    name: string,
    start: number,
    end: number,
    costTime: number, //路程
    studyTime: number, //持续多少分钟
    learn: learn[], //增加多少技能
    money: number, //花费
    needSkill: KeyObject<number>[], //需要的前置技能，如编程2级
}
//技能数据
export type learn = {
    id: number,
    name: string,
    exp: number,//每次课程增加的经验
    max: number,
}
// 事件数据
export type thingsModel = {
    id: number,
    name: number,
    time: number, //时间 单位分钟
    effect: attribute[],
    desc: string,
    randomEvent?: number[], //数组中随机一个
}
// 事件数据
export type actionType = {
    id: number | string,
    name: string,
    power: number, //精力 上限300, 初始值 100
    effect: object,
    desc: string,
    cost: number,
    type: string,
    randomEvent?: number[], //数组中随机一个
}
//资产数据 ，房子和车子

//物品数据
export type itemType = {
    // 物品属性
    id: number,
    name: string,
    mapId: number,
    desc: string,
    effect: {},
    price: number,
    stock:number,
    isOnce: boolean,
    time: number,
    type: string,
}
//学历
export type eduType ={
    id: number | string,
    name: string,
    desc: string,
    age: number,
    maxAge: number,
    year: number,
    type: string,
    need: string,
}
// 题目
export type questionType = {
    id: number,
    title: string,
    options: [],
    answer: number,
    type: string,
}
//证书
export type cardType = {
    id: string,
    name: string,
    time: number,
    count: number,
    score: number,
    desc: string,
    type: string,
    need: {
        edu: number
    },
    cost: number,
    between: number, //间隔时长
    leftTime: number, //剩余时长,
    have: number, //是否拥有
}
//地图
export type mapType = {
    id: number,
    name: string, //地点
    isLock: boolean, //是否解锁
    unlockCondition: {},
    location: number,//一个格子30分钟， 0个为20分钟，最大12小时
    desc: string,
    icon: string,
    type: string,//地点类型
    map: string,//模板类型
}
export type houseType = {
    id: number,
    locationName: string,
    location: number,
    effect: object,
    price: number,
    firstPay: number,
    monthPay: number,
    month: number,
    desc: number,
    configuration: number, //房屋配置的长度，对应配置的数组
}
export type roomItem = {
    id: number,
    name: string,
    desc: string,
    type: string, //根据房间类型获取对应的配套设施，是展示物品还是展示可以进行的动作行为
    itemType: string, //获取对应的房间的物品分类
}
export type carItem = {
    "id": number,
    "name": string,
    "effect": object,
    "desc": string,
    "cost": number,
    "price": number,
    "jam": number, //堵车风险
    "buyShop": number,
    "monthPay": number,
    "month": number,
    firstPay: number,
    powerEffect: number,
}
export type assetsType = {
    id: number,
    name: string,
    effect: object,
    price: number,
    firstPay: number, //首付
    monthPay: number, //月付
    desc: string,  //描述
    month: number, //剩余的月数
    leftMoney: number, //剩余钱
    monthCost: number,  //每个月支出
    type: string, //类型
    icon: string, //类型
    interest: number, //利息
    powerEffect: number,// 精力影响
}
export type lineEventType = {
    id: number,
    name: string, //
    desc: string, //提醒内容
    age: string, //年龄
    maxAge: number, //最大年龄
    year: number, //读的年数
}
export type diseaseType = {
    id: number,
    name: string,
    desc: string,
    cost: number,
    level: number,
    hurt: number, //每个月受伤的程度
}
export type hospitalType = {
    id: number,
    name: string,
    desc: string,
    power: number,
    percent: number, //痊愈比例
    level: number,
    money: number, //花费的比例
}
export type suduType = {
    puzzle: string,
    answer: string,
}
export type suduItemType = number;
export enum suduDiff {
    "easy" = 1,
    "hard",
    "medium",
    "extreme",
}
export type randomEventType = {
    id: number,
    name: string,
    desc: string,
    condition: Object,
    effect: Object,
    type: string,
    need: object,
    isSingle: number,
    fail: object,
    lose: string,
    result: string,
    btn: string[],
}
export type achieveType = {
    id: string,
    name: string,
    desc: string,
    cur: number,
    target: number,
    type: string,
    level: number,
    age: number,
    state: number,
}
export enum colliderType {
    "myMoney" = 0,
    "otherMoney" = 1,
    "myHome" = 2,
    "otherHome" = 3,
}
export type rankType = {
    id: number,
    name: string,
}